/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package midpmpc;

import org.j4me.ui.MenuItem;

/**
 *
 * @author vvs
 */
class CallbackMenuItem implements MenuItem{
    String _text;
    MenuListener _parent;
    public interface MenuListener
    {
        public void onMenuSelection (CallbackMenuItem item);
    }
    public CallbackMenuItem(String text,MenuListener listener)
    {
        _text=text;
        _parent=listener;
    }
    public void onSelection()
    {
        if (_parent!=null)
            _parent.onMenuSelection(this);
    }
    public String getText()
    {
        return _text;
    }
}
